< previous page page_441 next page >

Page 441
In previous releases of Visual Basic, the issue of Syntax errors were dealt with in the code editor. If you entered a line of code incorrectly, the code editor would alert you to the problem before you could continue. With Visual Basic 5, the code editor has been enhanced to display the syntax of the commands you can use and the valid properties, methods, or events that you could use on a given line of code. This enables you to concentrate more on the logic of your application than on your typing. However, after you fix a syntax error it will not occur again.
The next type of error that can occur is a Compile error. These occur when your code doesn't adhere to the Visual Basic command structure standards. Again, these errors are displayed to you when you compile the application, enabling you to fix and then forget them.
Logic errors are the hardest to find in an application because the application will execute without any errors occurring. However, the application will probably not process as you expected.
The final error type, runtime, occurs while the application is executing and causes it to end abnormally. This chapter shows you how to detect and repair runtime errors. Finding and fixing logic errors will be discussed on Day 18, Testing and Debugging the Application.
Error Types
Runtime errors usually occur in one of four similar groups of problems. The four types of Visual Basic errors are as follows:
General File errors
Physical errors
Code errors
Database errors
Each different type of error must be handled differently in your application. And, for each group of error, you will see what you can and cannot do to resolve them.
General File Errors
Most general file errors occur because invalid file information is processed by the application. A bad filename or invalid directory path will prevent most applications from continuing to process any information. Usually the user can fix these errors, and the application will continues from where the error occurred. The basic error handler for this type of error is to report the problem to the user and prompt him for the additional information to complete or retry the operation.

 
< previous page page_441 next page >

If you like this book, buy it!